<!DOCTYPE html>
<html>
{include file="public/head" /}
<link rel="stylesheet" href="/layuiadmin/layuiadmin/layui/css/layui.css" media="all">

<style>
    .layui-inline{width: 100%}
    .layui-form-label{width: 15%}
    .layui-form-item .layui-input-inline {
        float: left;
        width: 80%;
        margin-right: 10px;
    }
    .layui-form-label {
        padding: 9px 1px;
        text-align: left;
    }
    .form-footer2 {
         background-color: #ffffff;
         height: 0px;
         padding-top: 0px;
    }



    .layui-layer-btn .layui-layer-btn0 {
        border-color: #1aad19 !important;
        background-color: #1aad19 !important;
        color: #fff;
    }
    .tbody .table_cell{
        height: 25px !important;
    }
    .mod_default_box{
        box-shadow:none!important;
    }

    .layui-table, .layui-table-view {
        margin: 10px 0;
        margin-left: 25px;
    }
</style>
<body>
<div class="layui-fluid" id="app">
<div class="main_bd" style="padding-top: 0px;width: 800px">
    <div class="mod_default_box">
        <div class="mod_default_hd">

            <div class="btn btn_primary " onclick="preview(1)"
                 style="float: right" ref="add_from_lib" id="js_add_from_lib">
                打印订单
            </div>

            <!--startprint1-->

            <!--打印内容开始-->
            <div class="search_box">
                {$biz.name},订单号:{$order.order_id},备注:{$order.desc|default='无'}
            </div>


        </div>






        <table class="layui-table"  >
            <colgroup>
                <col width="150">
                <col width="200">
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>编号</th>
                <th>名称</th>
                <th>数量/单位</th>
                <th>实到</th>
                <th>金额</th>
            </tr>
            </thead>
            <tbody class="tbody">

            {foreach $list as $key => $item}
            <tr>
                <td class="table_cell lib_tmplmsg_id">{$key+1}</td>
                <td class="table_cell tl lib_tmplmsg_name">{$item.goods_name}</td>
                <td class="table_cell tl lib_tmplmsg_name">{$item.goods_num}/{$item.goods_unit}</td>
                <!--<td class="table_cell tl lib_tmplmsg_keywords">-->
                <!--<div class="lib_tmplmsg_keywords_list">-->
                <!--{$item.goods_unit}-->
                <!--</div>-->
                <!--</td>-->
                <td class="table_cell tr lib_tmplmsg_num ">

                </td>
                <td class="table_cell last_child lib_tmplmsg_opr">
                    <a class="global_link_opr js_select_tmpl js_edit" data-idx="0"
                       href="javascript:;"></a>
                    <!--<a class="global_link_opr js_select_tmpl" data-idx="0" href="#">删除</a>-->
                </td>
            </tr>
            {/foreach}


            {if condition="!$list"}
            <tr class="empty_item">
                <td colspan="5" class="empty_tips">暂无数据</td>
            </tr>
            {/if}


            </tbody>
        </table>
        <!--打印内容结束-->

        <!--endprint1-->


    </div>

</div>
</div>
</body>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            tp: ""
        },

    });

    layui.use(['form', 'laydate', 'upload'], function () {
        var $ = layui.$
            , element = layui.element
            , layer = layui.layer
            , laydate = layui.laydate
            , form = layui.form;
        var upload = layui.upload;

        form.render(null, 'component-form-group');

        laydate.render({
            elem: '#LAY-component-form-group-date'
        });






        /* 监听提交 */
        form.on('submit(bianji)', function (data) {

            var index = layer.confirm('确认继续执行？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                $.post('{:url("edit")}', data.field, function (res) {
                    if (res.code == 1) {

                        //将数据传入到父元素
//                        parent.app.items.push(data.field);
//                        $('.layui-form')[0].reset();
                        parent.init();
                        parent.layer.closeAll();
                        parent.layer.msg(res.msg, {icon: 1})
//                        $('#phone').val('');


                        return false;
                    } else {
                        parent.layer.msg(res.msg, {icon: 2})
                        return false;
                    }
                });
            }, function () {
                layer.close(index);
            });




            return false;
        });


        //封面上传
        upload.render({
            elem: '#pic1'
            , url: '/tool/qiniu/upload'
            , before: function () {
                layer.load(2);
            }
            , done: function (res) {
                layer.closeAll();
                console.log(res)
                $('#pic1 img').attr('src', res.data.url);//完整url
                $('#pic1 input').val(res.data.pic);//存入数据库中的部分url
            }
        });

    });





</script>
</html>










